package com.qf.sql;

import java.util.Map;

/**
 * 2019/11/9
 * Administrator
 * mybatis002
 * 面向对象面向君  不负代码不负卿
 */
public class StudentSql {

    //查询所有的sql
    public String  select(){
        return "select * from student";
    }
    public String selectbyname(Map map){
        StringBuffer stringBuffer = new StringBuffer("select * from student where 1=1 ");
        if(map.get("sname")!=null){
             stringBuffer.append(" and sname2 like '%"+map.get("sname")+"%'");
        }
        if(map.get("spass")!=null){
            stringBuffer.append(" and password="+map.get("spass"));
        }
        return stringBuffer.toString();
    }
}
